package ch2;

import ch1.Person;

//自定义类，加上泛型支持
//要求：泛型必须是Person或者他的子类
public class Page<T extends Person> {
	public void show(T t) {
		System.out.println(t.getName() + "," + t.getAge() + "," + t.getSex());
	}

	public static void main(String[] args) {
		// Page<String> p = new Page<>();
		// p.show("hi");
		Page<Person> p2 = new Page<>();
		p2.show(new Person("老吴", "女"));

		Page<Student> p3 = new Page<>();
		p3.show(new Student("小赵", 23, "女"));

	}
}
